package com.atguigu.flink.function;

import com.atguigu.flink.bean.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;

public class WaterSensorMapFunction implements MapFunction<String , WaterSensor > {
    @Override
    public WaterSensor map(String line) throws Exception {
        String[] file = line.split(" ");
        return new WaterSensor(file[0], Long.valueOf(file[1]), Integer.valueOf(file[2]));
    }
}
